package com.arpa.wms.service;

import com.arpa.wms.domain.dto.CustomerDTO;
import com.arpa.wms.domain.entity.Customer;
import com.arpa.wms.domain.vo.CustomerVO;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
 * <p>
 * 客户 服务类
 * </p>
 *
 * @author LEO
 * @since 2020-09-04
 */
public interface ICustomerService extends IService<Customer> {

    /**
     * 保存
     * @param entity
     * @return
     */
    @Override
    boolean save(Customer entity);

    /**
     * 根据code更新实体
     * @param entity
     * @return
     */
    int updateByCode(Customer entity);

    /**
     * 查询列表
     * @param customerDTO
     * @return
     */
    List<CustomerVO> queryList(CustomerDTO customerDTO);
     /**
      *  @author: Allen chen
      *  @Date: 2020/9/5 14:14
      *  @Description: 校验code和name
      */
    List<CustomerVO> queryByNameOrCode(CustomerDTO customerDTO);

    /**
     * 查询合计,包含总数
     * @param customerDTO
     * @return
     */
    CustomerVO queryListSum(CustomerDTO customerDTO);

     /**
      *  @author: Allen chen
      *  @Date: 2020/9/5 14:30
      *  @Description: 批量删除
      */
    int batchDelete(List<String> codes,String modifiedBy);

    List<CustomerVO> findCustomer();

    /**
     * 添加客户信息
     * @param entity
     */
    boolean save(CustomerDTO entity);

    /**
     * 获取客户信息
     * @param code 客户code
     * @return
     */
    CustomerVO getOneInfo(String code);

    /**
     * 更新客户信息
     * @param entity
     * @return
     */
    int updateByCode(CustomerDTO entity);

    /**
     * 客户信息审核
     * @param code 客户code
     * @param status 审核状态 1：通过。2不通过
     * @return
     */
    boolean approve(String code, int status);

    /**
     * 调整排序字段
     * @param customerDTO
     * @return
     */
    CustomerDTO adjustSortFields(CustomerDTO customerDTO);
}
